<?php
use yii\helpers\Url;
// $data_matrix = "https://proxcrm.xgate.com/barcode/frontend/web/index.php?r=qr/barcode&code=" . $userInfo['card_number'] . "&type=barcode";
$barcode = Url::to('@web/jebsen/codemaker/barcode.php?text=' . $userInfo['card_number']);
// echo $barcode;exit;
$this->title = '领取优惠券';
$signPackage = \app\components\Jssdk::getSignPackage();
?>
<script>
var signPackage = <?= json_encode($signPackage) ?>;
var timestamp = "<?= $sign['timestamp']?>"  
var nonce_str = "<?= $sign['nonce_str']?>"    
var signature = "<?= $sign['signature']?>"    

</script>
<div class="topContainer">
    <div class="weui-flex">
        <div class="weui-flex-item card" id="card">
            <div style="margin-top:30px;margin-bottom:30px;text-align:center;">
            	<h1>请领取您的优惠券</h1>
            	<hr/>
	    		<button style="border:1px solid #333;padding:6px;" type="button" class="btn btn-primary btn-lg" onclick="addCoupon()">领取优惠券</button>
			</div>
        </div>
    </div>
</div>
</body>
<?php

// $this->registerJsFile('//res.wx.qq.com/open/js/jweixin-1.2.0.js', ['depends' => [\app\assets\HxkjAsset::className()]]);
$this->registerJsFile('@web/hxkj/js/wxjs.js', ['depends' => [\app\assets\HxkjAsset::className()]]);

$this->registerJsFile('@web/hxkj/js/jssdk.js', ['depends' => [\app\assets\HxkjAsset::className()]]);

?>
</html>

<?php 
    $js = '
        $(".qrcode").click(function() {
            $("#barCard").fadeIn();
        })
        $("#card").click(function() {
            $("#barCard").fadeIn();
        })
    ';
    $this->registerJs($js, \yii\web\View::POS_END);
?>
<script>
	
</script>